<template>
  <div class="buychina">
    <template class="main">
      <el-table
          :data="GameList"
          border
          style="width: 100%">
        <el-table-column
            prop="name"
            label="游戏名称"
            width="280">
        </el-table-column><el-table-column
          prop="area"
          label="游戏区域"
          width="100%">
      </el-table-column>
        <el-table-column
            prop="lastprice"
            label="成交价格">
        </el-table-column>
        <el-table-column label="游戏状态">
          <template slot-scope="scope">
            <el-switch
                v-model="value"
                active-text="开"
                inactive-text="关"
                >
            </el-switch>
          </template>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
import {getgamelist} from "../../api";

export default {
  name: "BuyChina",
  data(){
    return{
      GameList:[],
      value:true,
    }
  },
  methods:{
    kai(){
      this.value = !this.value;
    }
  },
  created() {
    getgamelist(this.$store.getters.getUser.username).then((res) =>{
      this.GameList = res.data.GameList;
    })
  }
}
</script>

<style scoped>
.buychina{
  margin: 30px 30px;
}
.main{

}
</style>
